<?php $this->load->view('common/head');?>
<?php $this->load->view('common/navbar');?>
<div class="table-responsive">
<form class="form-inline" method="GET" action="<?php echo $this->input->server('REQUEST_URI'); ?>" name="queryForm" id="queryForm">
<input type="hidden" name="subType" id="subType" value="query">
<input type="hidden" name="c" id="c" value="Main">
<input type="hidden" name="m" id="m" value="adminDetail">
<input type="hidden" name="fundType" id="fundType" value="<?php echo $fundType; ?>">
<input type="hidden" name="area" id="area" value="<?php echo $area; ?>">
<input type="hidden" name="region" id="region" value="<?php echo $region; ?>">
<input type="hidden" name="spsarea" id="spsarea" value="<?php echo $spsarea; ?>">
  <div class="form-group">
    <label for="year">所属年份：</label>
    <select class="form-control" id="year" name="year">
	  <?php foreach ($yearList as $key => $value) {?>
	  <option value="<?=$key?>" <?=$year==$key ? 'selected="selected"' : ''?>><?php echo $value ?></option>
      <?php } ?>
	</select>
  </div>
  <div class="form-group">
    <label for="timeUnit">所属双月：</label>
    <select class="form-control" id="timeUnit" name="timeUnit">
      <?php foreach ($timeUnitList as $key => $value) {?>
	  <option value="<?=$key?>" <?=$timeUnit==$key ? 'selected="selected"' : ''?>><?php echo $value ?></option>
      <?php } ?>
	</select>
  </div>
  <div class="form-group">
    <label for="keyword">关键字：</label>
    <input type="text" class="form-control" name="keyword" id="keyword" value="<?=$keyword?>" placeholder="关键字">
  </div>
  <div class="form-group">
  <button type="button" class="btn btn-default btn-primary" onclick="queryFrom()">查询</button>
  <button type="button" class="btn btn-default btn-primary" onclick="exportExcel()">导出</button>
	</div>
</form>
	</div>
<div style="margin-top: 10px;">
  <?php
  if ($fundType == 1) {//专营店营销基金
  	$this->load->view('Main/part/commonDetailTable', $this->viewData);
  }elseif ($fundType == 2) {//区域营销基金
    $this->load->view('Main/part/areaDetailTable', $this->viewData);
  }elseif ($fundType == 3) {//车展基金
    $this->load->view('Main/part/carDetailTable', $this->viewData);
  }elseif ($fundType == 4) {//巡展基金
    $this->load->view('Main/part/xunDetailTable', $this->viewData);
  }elseif ($fundType == 5) {//专项基金
    $this->load->view('Main/part/specialDetailTable', $this->viewData);
  }
  ?>
</div>
<script type="text/javascript">
  function queryFrom(){
    $('#subType').val('query');
    $("#queryForm").submit();
  }
  function exportExcel(){
    $('#subType').val('export');
    $("#queryForm").submit();
  }
</script>
<?php $this->load->view('common/foot');?>